#!/bin/bash

process_name="ehui-admin"


source /etc/profile
git pull origin master
mvn clean
mvn compile
mvn install
pid=$(pgrep -f "$process_name")
    if [ -n "$pid" ]; then
      ps -ef|grep $process_name | grep -v grep | awk '{print $2}'|xargs kill -9
    fi
\cp ehui-admin/target/$process_name.jar /home/ehui/
chmod a+x /home/ehui/$process_name.jar
nohup java -jar /home/ehui/$process_name.jar >run.log 2>&1 &
